<%-- 
    Document   : departmentsList
    Created on : Oct 17, 2012, 9:15:38 AM
    Author     : DinhThang
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>Departments List</title>
            <link rel="stylesheet" type="text/css" href="../styles/style.css" />
        </head>
        <body>       
            <jsp:include page="../includes/incHeader.jsp" flush="false" />
            <h3>Departments List</h3>
           <h:form>  
                <center>
                    <h:commandLink value="Add New" action="addNewDepart"/></center><br/>
                    <h:messages/>
                    <h:dataTable style="margin:0 auto; border:1px solid #999; width:60%" value="#{departmentsBean.deparList}" var="depart" rendered="#{not empty departmentsBean.deparList}">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Department Name"/>
                            </f:facet>
                            <h:outputText value="#{depart.departmentName}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="Is active"/>
                            </f:facet>
                            <h:outputText value="#{depart.isEnable}"/>
                        </h:column>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Delete"/>
                        </f:facet>
                        <h:commandLink value="Del" action="#{departmentsBean.prepareData4Delete}">
                            <f:param name="idParam" value="#{depart.departmentID}"/>
                        </h:commandLink>
                    </h:column>

                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Update"/>
                        </f:facet>
                        <h:commandLink value="Edit" action="#{departmentsBean.prepareData4Update}">
                            <f:param name="idParam" value="#{depart.departmentID}"/>
                        </h:commandLink>
                    </h:column>
                </h:dataTable>
            </h:form>

            <jsp:include page="../includes/incFooter.jsp" flush="false" />
        </body>
    </html> </f:view>


